<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath ="/common/opensource/mxgraph/examples/editors/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>mxGraph Workflow Example</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<style type="text/css" media="screen">
		div.base {
			position: absolute;
			overflow: hidden;
			white-space: nowrap;
			font-family: Arial;
			font-size: 8pt;
		}
		div.base#graph {
			border-style: solid;
			border-color: #F2F2F2;
			border-width: 1px;
			background: url('/common/opensource/mxgraph/examples/editors/images/grid.gif');
		}
	</style>
		<script type="text/javascript">
mxBasePath = '/common/opensource/mxgraph/src';
</script>
		<%
			String userAgent = request.getHeader("User-Agent").toString();
			//System.out.println(userAgent + "   ");
			if (userAgent.indexOf("MSIE 6.") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-ie.js">
</script>
		<%
			} else if (userAgent.indexOf("Firefox") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-ff.js">
</script>
		<%
			} else if (userAgent.indexOf("Chrome") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-chrome.js">
</script>
		<%
			} else if (userAgent.indexOf("Opera") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-opera.js">
</script>
		<%
			} else if (userAgent.indexOf("Safari") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-safari.js">
</script>
		<%
			} else {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-ie.js">
</script>
		<%
			}
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxApplication.js">
</script>
		<script type="text/javascript">
mxConstants.DEFAULT_HOTSPOT = 1;
// Enables guides
mxGraphHandler.prototype.guidesEnabled = true;
// Alt disables guides
mxGuide.prototype.isEnabledForEvent = function(evt) {
	return !mxEvent.isAltDown(evt);
};

// Enables snapping waypoints to terminals
mxEdgeHandler.prototype.snapToTerminals = true;

window.onbeforeunload = function() {
	return mxResources.get('changesLost');
};
function createXml(str) {
    if (document.all) {
        var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
        xmlDom.loadXML(str);
        return xmlDom;
    }else{
    return new DOMParser().parseFromString(str, "text/xml");
    }
};

function attToObject(attributes){
	var object = {};
	for ( var i = 0; i < attributes.length; i++) {
			object[attributes[i].nodeName]=attributes[i].nodeValue;
	}
	return object;
}
var dataId = '<%=request.getParameter("dataId")==null?"":request.getParameter("dataId")%>';
var objectId = null;
var mxDocument = null;
</script>
<link rel="stylesheet" type="text/css" href="/common/opensource/ext/resources/css/<%=request.getParameter("theme")==null?"":request.getParameter("theme")%>.css" />
<link rel="stylesheet" type="text/css" href="/common/opensource/ext/shared/example.css" />
<link rel="stylesheet" type="text/css" href="/common/css/icons.css" />
<link rel="stylesheet" type="text/css" href="/common/css/ext/external.css" />
<link rel="stylesheet" type="text/css" href="/common/css/ext/dataview.css" />
<link rel="stylesheet" type="text/css" href="/common/opensource/ext/ux/css/ItemSelector.css" />
<link rel="stylesheet" type="text/css" href="/common/opensource/ext/ux/css/CheckHeader.css" />
<script type="text/javascript" src="/common/opensource/ext/ext-all-debug.js"></script>
<script type="text/javascript" src="/common/opensource/ext/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="/common/opensource/ext/shared/examples.js"></script>
<script type="text/javascript" src="/common/opensource/ext/ux/grid/ProgressBarPager.js"></script>
<script type="text/javascript" src="/common/opensource/ext/ux/TabCloseMenu.js"></script>
<script type="text/javascript" src="/common/opensource/ext/ux/CheckColumn.js"></script>
<script type="text/javascript" src="/common/opensource/ext/ux/form/MultiSelect.js"></script>
<script type="text/javascript" src="/common/opensource/ext/ux/form/ItemSelector.js"></script>
<script type="text/javascript" src="/common/opensource/ext/ux/grid/RowExpander.js"></script>
<script type="text/javascript" src="/common/js/global/ExtVtype.js"></script>
<script type="text/javascript" src="/common/js/global/util.js"></script>
<script type="text/javascript" src="/common/js/global/ExtComponentUtil.js"></script>
<script type="text/javascript" src="/common/js/global/UrlUtil.js"></script>
<script type="text/javascript" src="/common/js/global/uuid.js"></script>
<script type="text/javascript" src="/common/js/global/login.js"></script>
<script type="text/javascript" src="/common/js/global/Extoverride.js"></script>

<script type="text/javascript" src="/common/js/base/BaseDataModel.js"></script>
<script type="text/javascript" src="/common/js/base/BaseDataStore.js"></script>
<script type="text/javascript" src="/common/js/base/BaseFormPanel.js"></script>
<script type="text/javascript" src="/common/js/base/BaseGridPanel.js"></script>
<script type="text/javascript" src="/common/js/base/BaseGridStore.js"></script>
<script type="text/javascript" src="/common/js/base/BasePagingToolbar.js"></script>
<script type="text/javascript" src="/common/js/base/BasePanel.js"></script>
<script type="text/javascript" src="/common/js/base/BaseTabPanel.js"></script>
<script type="text/javascript" src="/common/js/base/BaseToolbar.js"></script>
<script type="text/javascript" src="/common/js/base/BaseTreePanel.js"></script>
<script type="text/javascript" src="/common/js/base/BaseTreeStore.js"></script>
<script type="text/javascript" src="/common/js/base/BaseWindow.js"></script>


<script type="text/javascript">
var Init = {
		init : function() {
			new mxApplication('/common/opensource/mxgraph/examples/editors/config/workfloweditor.xml');
			setTimeout("Init.initHeight();", 100);
		},
		initHeight : function() {
			Ext.override(com.hh.base.BaseWindow, {
				width : BrowserContext.getBrowserWidth() - 300,
				height : BrowserContext.getBrowserHeight() - 80
			});
		}
	}
	$import([ "com.hh.global.widget.ComboBoxTree",
			"com.hh.global.widget.ComboBoxMultiTree",
			"com.hh.global.BaseSimpleTreePanel",
			"com.hh.global.SimpleGridPanelWindow",
			"com.hh.global.NavigAtionWindow",
			"com.hh.global.SimpleFormPanelWindow",
			"com.hh.global.SimpleGroupGridPanel",
			"com.hh.global.SimpleTreePanel", 
			"com.hh.global.widget.ComboBox",
			"com.hh.global.widget.DateTimeField",
			"com.hh.global.widget.FileGridField",
			"com.hh.global.widget.FileWindow",
			"com.hh.global.widget.ItemSelector",
			"com.hh.global.widget.PropertiesGridField",
			"com.hh.global.widget.RadioGroup",
			"com.hh.usersystem.user.UserSelect",
			"com.hh.global.widget.GridField"  ]);
			this.parent.Doing.hidden(true);
</script>


<script type="text/javascript" src="<%=basePath %>properties/SimpleFormPanelWindow.js"></script>
<script type="text/javascript" src="<%=basePath %>properties/WorkFlow.js"></script>
<script type="text/javascript" src="<%=basePath %>properties/UserTask.js"></script>
<script type="text/javascript" src="<%=basePath %>properties/Edge.js"></script>
</head>
<body onload="Init.init();">
	<table id="splash" width="100%" height="100%"
		style="background:white;position:absolute;top:0px;left:0px;z-index:4;">
		<tr>
			<td align="center" valign="middle">
				<img src="<%=basePath %>images/loading.gif">
			</td>
		</tr>
	</table>
	<div id="graph" class="base">
		<!-- Graph Here -->
	</div>
	<div id="status" class="base" align="right">
		<!-- Status Here -->
	</div>
</body>
</html>
